<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    body {
      width: 100vw;
      height: 100vh;
      background: #34495e;
      display: flex;
      justify-content: center;
      align-items:  center;
    }
    div {
      position: relative;
      width: 200px;
      height: 200px;
      background-color: #9b59b6;
      /* transition: 2s; */
      transition-property: background, border-radius;
      transition-duration: 2s;
    }
      /* transition: 2s; 可以继承，也可以独立控制 */
    /* div:hover {
      background: #e74c3f;
      border-radius: 50%;
    } */
    div::before {
      content: "text";
      position: absolute;
      width: 200px;
      height: 200px;
      border-radius: 10%;
      font-size: 3em;
      background: #95a5a6;
      display: flex;
      justify-content: center;
      align-items: center;
      transition-duration: 2s;
      transition-timing-function: steps(3, start);
    }
    div:hover::before {
      transform: rotate(360deg);
    }
    div::after {
      content: "text";
      position: absolute;
      bottom: -55px;
      width: 200px;
      text-align: center;
      color: #95a5a6;
      font-size: 1.8em;
      transform: translateX(-999px) skew(45deg);
      transition-duration: 1s;
    }
    div.move::after {
      transform: translateX(0px) skew(0deg);
    }
    /* 过渡需要有中间值 */
  </style>
</head>
<body>
  <div></div>
  <script>
    document.querySelector('div').addEventListener('transitionend', function(e) {
      console.log(e)
      document.querySelector('div').className = 'move';
    })
  </script>
</body>
</html>